package com.zju.searchEngine.controller;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.zju.searchEngine.model.Index;
import com.zju.searchEngine.service.IIndexService;

import net.sf.json.JSONArray;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath*:beans.xml" })
public class MyTest {
	
	@Autowired
	private IIndexService indexService;
	
	@Test
	public void test(){
		List<Index> list = indexService.selectByKeyWordLike("");
		for (Index index : list) {
			System.out.println(index.toString());
		}
	}
	
	@Test
	public void test1(){
		String keyWordStr = "";
		String[] keyWords = keyWordStr.split(" ");
		
		System.out.println(keyWords.length);
		for(String keyWord:keyWords){
			System.out.println("111");
			System.out.println(keyWord);
		}

	}

}
